<?php

class Home extends CI_Controller {

    function __construct() {
        parent::__construct();

        // Load the necessary stuff...
        $this->load->helper(array('language', 'url', 'form', 'account/ssl'));
//        $this->load->library(array('account/authentication'));
        $this->load->model(array('account/account_model', 'kierunek_model'));
        $this->lang->load(array('general'));
    }

    function index($letter = 'a', $kierunek = 'archeologia') {
        maintain_ssl();

        if ($this->authentication->is_signed_in()) {
            $data['account'] = $this->account_model->get_by_id($this->session->userdata('account_id'));
        }

        $vars = array();
        $vars['main_content'] = 'home';
        isset($data) ? $vars['data'] = $data : NULL;
        $vars['kierunki'] = $this->kierunek_model->get_by_letter($letter);
        $vars['selected_litera'] = $letter;
        $vars['selected_kierunek'] = $kierunek;

        $this->load->view('includes/template', $vars);
    }

}

/* End of file home.php */
/* Location: ./system/application/controllers/home.php */